// base
import Taro, { Component } from '@tarojs/taro'
import { View, Image } from '@tarojs/components'
import { dealImgUrl } from '../../../../configuration/staticimg'

// less
import './index.less'

class CompanyIntro extends Component {
  static defaultProps = {
    detail: {}
  }
  componentWillMount () {
    // onLoad
  }

  componentDidMount () {
    // onready
  }

  componentDidShow () {
    // onshow
  }

  componentDidHide () {
    // onhide
  }

  componentWillUnmount () {
    // onUnload
  }

  delay (time = 0) {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve()
      }, time)
    })
  }

  render () {
    const detail = this.props.detail
    console.log(detail, 'dealImgUrldealImgUrl')
    return (
      <View className="CompanyIntro_id71731">
        <View className="localwrap">
          <View className="singlewrap">
            <View className="single">
              <View className="titlewrap">
                <View className="titlewrapl">
                  <View className="titlewraplt">{detail.companyName || ''}</View>
                  <View className="titlewraplb">{detail.simpleName || ''}</View>
                </View>
                <View className="titlewrapr">
                  <Image src={dealImgUrl(detail.companyLogo) || ''} mode="aspectFill" className="titleimg" />
                </View>
              </View>
              <View className="tagswrap">
                {this.props.detail.tags.map(data => {
                  return data !== 'undefined' ? <View className="tagsingle">{data}</View> : null
                })}
              </View>
            </View>
          </View>
        </View>
      </View>
    )
  }
}

export default CompanyIntro
